package com.bsoft.gol.editor.controller;

import ctd.controller.exception.ControllerException;
import hcn.util.BaseResponse;
import com.bsoft.gol.editor.editor.EditorOrganization;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.bsoft.gol.editor.service.EditorOrganizationApi;


@RestController
@RequestMapping(value = "/api/auth/editoOrganization")
public class EditorOrganizationController {


    @Autowired
    private EditorOrganizationApi editorOrganizationApi;




    @RequestMapping("/organizationAdd")
    @ResponseBody
    public BaseResponse organizationAdd(@RequestBody EditorOrganization req) throws ControllerException {

        BaseResponse<EditorOrganization> response = new BaseResponse<>();

            response=editorOrganizationApi.add(req);

        return response;
    }


    @RequestMapping("/organizationList")
    @ResponseBody
    public BaseResponse organizationList(@RequestBody EditorOrganization req) throws ControllerException {

        BaseResponse<EditorOrganization> response = new BaseResponse<>();

        response=editorOrganizationApi.list(req);

        return response;
    }

}
